/**
 * Copyright (C) 2022-2023
 * All rights reserved, Designed By www.tonetn.com
 * 注意：
 * 本软件为www.tonetn.com开发研制，未经购买不得使用
 * 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 * 一经发现盗用、分享等行为，将追究法律责任，后果自负
 */
package com.xunyin.modules.device.service;

import com.xunyin.common.service.BaseService;
import com.xunyin.modules.device.domain.TDevice;
import com.xunyin.modules.device.service.dto.TDeviceDto;
import com.xunyin.modules.device.service.dto.TDeviceQueryCriteria;
import org.springframework.data.domain.Pageable;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author admin
 * @date 2022-10-15
 */
public interface TDeviceService extends BaseService<TDevice> {

    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String, Object>
     */
    Map<String, Object> queryAll(TDeviceQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<TDevice>
     */
    List<TDevice> queryAll(TDeviceQueryCriteria criteria);

    /**
     * 开门
     * @param tDeviceDto
     */
    String openDoor(TDeviceDto tDeviceDto) throws Exception;

    /**
     * 远程开门
     * @param doorDeviceId
     * @return
     */
    String remoteOpenDoor(Integer doorDeviceId);

    /**
     * 根据门店id -所有茶室的门禁复位
     * @param storeId
     * @return
     */
    Boolean doorResetByStoreId(Integer storeId) throws Exception;
    //Boolean doorResetByTeaId(Integer teaHouseId);

    Boolean doorResetByStoreIdProg1(Integer storeId);

    String remoteOpenDoorProg1(Integer doorDeviceId) throws Exception;

    String openDoorProg1(TDeviceDto tDeviceDto) throws Exception;

    /**
     * 门店管理员开门
     *
     */
    String adminOpenDoor(String hardwareProg,Integer storeId,Integer storeRoomId,Integer deviceType) throws Exception;

    //List<TDevice> getDoorListByTeaHouseId(Integer teaHouseId) throws IOException;
    List<TDevice> getDeviceListByStoreRoomIdOrStoreId(Integer storeId, Integer storeRoomId, Integer deviceTypeFlag) throws IOException;

    TDevice getPowerDeviceByStoreRoomIdOrStoreId(Integer storeId, Integer storeRoomId,Integer deviceType);

}
